package com.smartcampusbackend.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.smartcampusbackend.model.LikeRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface LikeRecordMapper extends BaseMapper<LikeRecord> {
    
    // 检查用户是否已点赞
    LikeRecord findByUserAndTarget(@Param("userId") Integer userId, @Param("targetType") String targetType, @Param("targetId") Integer targetId);
    
    // 获取点赞数量
    int countByTarget(@Param("targetType") String targetType, @Param("targetId") Integer targetId);
    
    // 删除点赞记录
    int deleteByUserAndTarget(@Param("userId") Integer userId, @Param("targetType") String targetType, @Param("targetId") Integer targetId);
} 